/*
 * @Author: your name
 * @Date: 2022-01-06 13:21:32
 * @LastEditTime: 2022-01-08 15:13:19
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \agricultural-production-web\src\api\conservation-model\model-data\index.js
 */
import con from "@/api/axios";
import zhreq from "@/api/axios";

export default {
  /**
   * @description:分页查询接口
   * @param {Number}  page
   * @param {Number}  size
   * @return {Object}
   */
  queryPageList(params) {
    return con.get("/growthModel/queryPageList", params);
  },
  /**
   * @description:根据基地跟种养类型查询
   * @param {Number}  organizationNo
   * @param {Number}  plantingTypeId
   * @return {Object}
   */
  queryByOrganizationIdAndType(params) {
    return con.get("/growthModel/queryByOrganizationIdAndType", params);
  },
  /**
   * @description:主键查询接口
   * @param {Number}  growthModelId
   * @return {Object}
   */
  query(params) {
    return con.get("/growthModel/query", params);
  },
  /**
   * @description:修改
   * @param {Number}  growthModelId
   * @param {String}  modelName
   * @param {Number}  plantingTypeId
   * @param {Array}  growthModelStageList
   * @return {Object}
   */
  edit(params) {
    return con.post("/growthModel/edit", params);
  },
  /**
   * @description:添加
   * @param {String}  modelName
   * @param {Number}  plantingTypeId
   * @param {Array}  growthModelStageList
   * @return {Object}
   */
  add(params) {
    return con.post("/growthModel/add", params);
  },
  /**
   * @description:删除
   * @param {Array}  growthModelIdList
   * @return {Object}
   */
  del(params) {
    return con.post("/growthModel/delList", params);
  },
  /**
   * @description:通过组织机构查询数据类型
   * @return {Object}
   */
  queryGrowthPhasePicture(params) {
    return con.getL(
      `/cumulative/cum/queryGrowthPhasePicture/${params.pictureId}`
    );
  },
  /**
   * @description:通过组织机构查询数据类型
   * @return {Object}
   */
  queryDataType(params) {
    return zhreq.get(
      `sensorFacilityMapper/queryDataType/${params.organizationNo}`
    );
  }
};
